A programming language is a formal constructed language designed to provide (communicate) instructions to a machine, particularly a computer. A typical programming language includes a vocabulary and set of grammatical rules for instructing the machine to perform specific tasks. Typically, a programming language is used to generate a software program that controls the behavior of the machine to express algorithms, or otherwise to cause the machine to perform some function or functions. Well-known programming languages include Java, Javascript, PHP, C++, Python, C, SQL, and Objective C.
Programming languages may use class loaders to load class files or other code-containing objects for execution. For example, the Java language uses a class loading mechanism to dynamically load class files of an application into the Java™ Virtual Machine during runtime. Loading classes from the extension and application classpath is a heavy-weight process (i.e., computationally intensive) that typically requires multiple classpath searches, JAR file lookups, class verification, etc. In a typical Java™ application environment, the total time required to perform class-loading may negatively impact overall application start-up time.
Class Data Sharing is a process that was implemented to resolve such start-up time issues by archiving loaded class metadata into a re-mappable form before the execution of an application. However, Class Data Sharing does not allow classes from the extension and application classpath to be stored in the archive without violating class-loader context and Java™ semantics, which can cause incorrect runtime behavior and security vulnerability.
Various examples described herein may use example terminology that coincides with terminology used for the Java programming language. Unless otherwise specified, such terminology is intended to be language-generic based on functional characteristics rather than implying any characteristics that are unique to the Java ecosystem. For example, a class is any named section of software code that can be invoked, including, but not limited to, a function, a method, a procedure, an object, and a Java class (i.e., “class” is not required to be a Java class). As another example, a class loader is any mechanism for loading a class prior to or during execution of code (i.e., a “classloader” is not required to be a Java classloader). In yet another example, a classpath is a parameter, set either on the command line, or through an environment variable that tells a computing environment and/or compiler, such as the Java virtual machine or the Java compiler, where to look for user-defined classes.